package basic.com.liz.learn.design.mediator;

public class MyMediator implements Mediator
{
    private User1 user1;
    
    private User2 user2;
    
    @Override
    public void createMediator()
    {
        this.user1 = new User1(this);
        this.user2 = new User2(this);
    }
    
    @Override
    public void workAll()
    {
        user1.work();
        user2.work();
        user2.donotWork();
    }
    
    public User1 getUser1()
    {
        return user1;
    }
    
    public void setUser1(User1 user1)
    {
        this.user1 = user1;
    }
    
    public User2 getUser2()
    {
        return user2;
    }
    
    public void setUser2(User2 user2)
    {
        this.user2 = user2;
    }
    
    public MyMediator(User1 user1, User2 user2)
    {
        super();
        this.user1 = user1;
        this.user2 = user2;
    }
    
    public MyMediator()
    {
        super();
    }
    
}
